function computLottery(data, targetData) {
    if (!targetData) {
        var rdmValue = random(0, data.length)
        var lotteryData = data.splice(rdmValue, 1);
        return { data, lotteryData }
    }
    else {
        var indexOfTarget = data.findIndex(x => x[0] == targetData.key)
        var lotteryData = data.splice(indexOfTarget, 1)
        return { data, lotteryData }
    }
}
function random(n, m) {
    var c = m - n + 1;
    return Math.floor(Math.random() * c + n);
} 